//@author A0099983B
#pragma once
#include <msclr/marshal_cppstd.h>
#include "TaskItScheduler.h"
#include "TaskItHelp.h"
#include <cliext/vector>
//@author IDE
namespace UI {
	using namespace System;
	using namespace cliext;
	using namespace System::ComponentModel;
	using namespace System::Collections;
	using namespace System::Windows::Forms;
	using namespace System::Data;
	using namespace System::Drawing;

	//@author A0099983B
	/// <summary>
	///The TaskItGUI Class is responsible to take in input from the user through
	///the use of a userInputBox. It will pass the input to TaskItScheduler to process
	//the input and receive system output from it to display to the user.
	/// </summary>
	public ref class TaskItGUI : public System::Windows::Forms::Form {
	private:
		literal String^ EMPTY_STRING = "";
		literal String^ USERNAME = "Jim";
		literal String^ COMMAND_ADD = "add";
		literal String^ COMMAND_BLOCK = "block";
		literal String^ COMMAND_MARK = "mark";
		literal String^ COMMAND_SEARCH = "search";
		literal String^ COMMAND_UNDO = "undo";
		literal String^ COMMAND_EDIT = "edit";
		literal String^ COMMAND_VIEW = "view";
		literal String^ COMMAND_DELETE = "delete";
		literal String^ COMMAND_UNMARK = "unmark";
		literal String^ COMMAND_FEDIT = "fedit";
		literal String^ COMMAND_FDELETE = "fdelete";
		literal String^ COMMAND_HELP = "help";
		literal String^ COMMAND_CONFIRM = "confirm";
		literal String^ COMMAND_CLEAR = "clear";
		literal String^ ADD_WITH_PROMPTS = "add [activity][venue][time start][time end][category][ddmmyy]";
		literal String^ EDIT_WITH_BASIC_PROMPTS = "edit [no.]";
		literal String^ FDELETE_WITH_PROMPTS = "fdelete [no.]";
		literal String^ FEDIT_WITH_BASIC_PROMPTS = "fedit [no.]";
		literal String^ VIEW_WITH_PROMPTS = "view [all/category/date]";
		literal String^ DELETE_WITH_PROMPTS = "delete [no.]";
		literal String^ SEARCH_WITH_PROMPTS = "search [keyword]";
		literal String^ BLOCK_WITH_PROMPTS = "block [activity][venue][time start][time end][category][ddmmyy]";
		literal String^ MARK_WITH_PROMPTS = "mark [no.]";
		literal String^ UNMARK_WITH_PROMPTS = "unmark [no.]";
		literal String^ CONFIRM_WITH_PROMPTS = "confirm [no.]";
		literal String^ SPACE = " ";
		literal String^ OPEN_SQ_BRACKET = "[";
		literal String^ CLOSE_SQ_BRACKET = "]";
		literal char CHAR_SPACE = ' ';
		literal char CHAR_OPEN_SQ_BRACKET = '[';
		literal char CHAR_CLOSE_SQ_BRACKET = ']';

		literal String^ DIGIT_ONE = "1";
		literal String^ DIGIT_TWO = "2";
		literal String^ DIGIT_THREE = "3";
		literal String^ DIGIT_FOUR = "4";
		literal String^ DIGIT_FIVE = "5";
		literal String^ DIGIT_SIX = "6";
		literal String^ DIGIT_SEVEN = "7";
		literal String^ DIGIT_EIGHT = "8";
		literal String^ DIGIT_NINE = "9";
		literal String^ DIGIT_ZERO = "0";

		literal String^ INVALID_EDIT_ITEM = "-1";

		literal String^ WHAT_YOU_YOU_LIKE_TO_DO = "What would you like to do?";
		literal String^ NO_INPUT_DETECTED = "No input detected. Pls try again.";

		literal String^ DONE = "Done";

		literal String^ LOG_CALLED_SCHEDULER = "Called TaskItScheduler to execute command.";
		literal String^ LOG_SMALL_UI_DISPLAY = "Displayed information in small UI window.";
		literal String^ LOG_BIG_UI_DISPLAY = "Display information in big UI window.";
//@author A0096509U
		static const int WIDTH_TO_CHARACTER_DISPLAY_RATIO = 10;
		static const int MAX_TOTAL_NO_OF_FIELDS = 8;
		static const int LENGTH_OF_ADD = 3;
		static const int LENGTH_OF_EDIT = 4;
		static const int LENGTH_OF_VIEW = 4;
		static const int LENGTH_OF_MARK = 4;
		static const int LENGTH_OF_BLOCK = 5;
		static const int LENGTH_OF_FEDIT = 5;
		static const int LENGTH_OF_DELETE = 6;
		static const int LENGTH_OF_UNMARK = 6;
		static const int LENGTH_OF_SEARCH = 6;
		static const int LENGTH_OF_FDELETE = 7;
		static const int LENGTH_OF_CONFIRM = 7;
		static const int LENGTH_OF_ACTIVITY = 8;
		static const int LENGTH_OF_NO_DOT = 3;
		static const int LENGTH_OF_ALL_CATEGORY_DATE = 17;
		static const int LENGTH_OF_KEYWORD = 7;
		static const int LENGTH_OF_HELP = 4;
		static const int LENGTH_OF_UNDO = 4;
		static const int LENGTH_OF_CLEAR = 5;
		static const int LENGTH_OF_SEARCH_PROMPT_WITH_NO_KEYWORD = 9;
		static const int LENGTH_OF_EDIT_BASIC_PROMPT_NO_DIGIT = 7;
		static const int LENGTH_OF_EDIT_BASIC_PROMPT_ONE_DIGIT = 8;
		static const int LENGTH_OF_EDIT_BASIC_PROMPT_TWO_DIGITS = 9;
		static const int LENGTH_OF_EDIT_BASIC_PROMPT_THREE_DIGITS = 10;
		static const int LENGTH_OF_EDIT_BASIC_PROMPT_FOUR_DIGITS = 11;
		static const int LENGTH_OF_FEDIT_BASIC_PROMPT_NO_DIGIT = 8;
		static const int LENGTH_OF_FEDIT_BASIC_PROMPT_ONE_DIGIT = 9;
		static const int LENGTH_OF_FEDIT_BASIC_PROMPT_TWO_DIGITS = 10;
		static const int LENGTH_OF_FEDIT_BASIC_PROMPT_THREE_DIGITS = 11;
		static const int LENGTH_OF_FEDIT_BASIC_PROMPT_FOUR_DIGITS = 12;

		static const int POS_LAST_CHAR_BEFORE_FIRST_CLOSE_BRACKET_EDIT_ONE_DIGIT = 7;
		static const int POS_LAST_CHAR_BEFORE_FIRST_CLOSE_BRACKET_EDIT_TWO_DIGITS = 8;
		static const int POS_LAST_CHAR_BEFORE_FIRST_CLOSE_BRACKET_EDIT_THREE_DIGITS = 9;
		static const int POS_LAST_CHAR_BEFORE_FIRST_CLOSE_BRACKET_EDIT_FOUR_DIGITS = 10;

//@author A0096440E
		static const int POS_LAST_CHAR_BEFORE_FIRST_CLOSE_BRACKET_FEDIT_ONE_DIGIT = 8;
		static const int POS_LAST_CHAR_BEFORE_FIRST_CLOSE_BRACKET_FEDIT_TWO_DIGITS = 9;
		static const int POS_LAST_CHAR_BEFORE_FIRST_CLOSE_BRACKET_FEDIT_THREE_DIGITS = 10;
		static const int POS_LAST_CHAR_BEFORE_FIRST_CLOSE_BRACKET_FEDIT_FOUR_DIGITS = 11;

		static const int BEGINNING_POS_OF_STR = 0;

		static const int ONE_DIGIT = 1;
		static const int TWO_DIGITS = 2;
		static const int THREE_DIGITS = 3;
		static const int FOUR_DIGITS = 4;

		static const int POS_FIRST_OPEN_BRACKET_FOR_EDIT = 5;
		static const int POS_FIRST_CLOSE_BRACKET_EDIT_ONE_DIGIT = 7;
		static const int POS_FIRST_CLOSE_BRACKET_EDIT_TWO_DIGITS = 8;
		static const int POS_FIRST_CLOSE_BRACKET_EDIT_THREE_DIGITS = 9;
		static const int POS_FIRST_CLOSE_BRACKET_EDIT_FOUR_DIGITS = 10;

		static const int POS_FIRST_OPEN_BRACKET_FOR_FEDIT = 6;
		static const int POS_FIRST_CLOSE_BRACKET_FEDIT_ONE_DIGIT = 8;
		static const int POS_FIRST_CLOSE_BRACKET_FEDIT_TWO_DIGITS = 9;
		static const int POS_FIRST_CLOSE_BRACKET_FEDIT_THREE_DIGITS = 10;
		static const int POS_FIRST_CLOSE_BRACKET_FEDIT_FOUR_DIGITS = 11;

		static const int POS_AFTER_FIRST_OPEN_BRACKET_FOR_ADD = 5;
		static const int POS_AFTER_FIRST_OPEN_BRACKET_FOR_VIEW = 6;
		static const int POS_AFTER_FIRST_OPEN_BRACKET_FOR_DELETE = 8;
		static const int POS_AFTER_FIRST_OPEN_BRACKET_FOR_SEARCH = 8;
		static const int POS_AFTER_FIRST_OPEN_BRACKET_FOR_MARK = 6;
		static const int POS_AFTER_FIRST_OPEN_BRACKET_FOR_UNMARK = 8;
		static const int POS_AFTER_FIRST_OPEN_BRACKET_FOR_FDELETE = 9;
		static const int POS_AFTER_FIRST_OPEN_BRACKET_FOR_BLOCK = 7;
		static const int POS_AFTER_FIRST_OPEN_BRACKET_FOR_COMFIRM = 9;
		static const int POS_AFTER_FIRST_OPEN_BRACKET_FOR_EDIT = 6;
		static const int POS_AFTER_FIRST_OPEN_BRACKET_FOR_FEDIT = 7;

		static const int LENGTH_OF_OPEN_SQ_BRACKET = 1;
		static const int LENGTH_OF_CLOSE_SQ_BRACKET = 1;
		static const int LENGTH_OF_A_SPACE = 1;
		static const int LENGTH_OF_A_DIGIT = 1;
		static const int LENGTH_OF_A_CHAR = 1;
		static const int FIRST_FIELD = 1;
		static const int POS_OF_FIRST_DATE_IN_VECTOR = 6;
		static const int LENGTH_OF_A_SEVEN_LETTER_COMMAND = 7;
		static const int LENGTH_OF_A_SIX_LETTER_COMMAND = 6;
		static const int LENGTH_OF_A_FIVE_LETTER_COMMAND = 5;
		static const int LENGTH_OF_A_FOUR_LETTER_COMMAND = 4;
		static const int LENGTH_OF_A_THREE_LETTER_COMMAND = 3;
		static const int INITIAL_VALUE = 0;

		static const int NO_FIELD = 0;
		static const int TWO_FIELDS = 2;
		static const int SEVEN_FIELDS = 7;
		static const int EIGHT_FIELDS = 8;

		static const int ONE_SET_OF_BRACKET = 1;
		static const int SIX_SETS_OF_BRACKET = 6;
		static const int SEVEN_SETS_OF_BRACKET = 7;

		static const int YEAR_TWO_THOUSAND = 2000;
		static const int NO_OPEN_BRACKET = 0;
		static const int NO_CLOSE_BRACKET = 0;
		static const int NO_BRACKET_FOUND = 0;
		static const int NO_REMAINDER = 0;
		static const int ONE_REMAINDER = 1;
		static const int MIN_LENGTH_OF_COMMAND = 3;
		static const int EVEN_NO_TWO = 2;
		static const int SKIP_OPEN_SQ_BRACKET = 1;
		static const int SKIP_CLOSE_SQ_BRACKET = -1;
		static const int SKIP_LAST_FIELD = 1;
		static const int ONE_DIFFERENCE_BTN_OPEN_CLOSE_BRACKETS = 1;
		static const int ACCOUNT_FOR_CONV_FROM_POS_TO_SIZE = 1;
		static const int ACCOUNT_FOR_CONV_FROM_POS_TO_LENGTH = 1;
		static const int ACCOUNT_FOR_CONV_FROM_SIZE_TO_POS = 1;
		static const int ACCOUNT_FOR_CONV_FROM_LENGTH_TO_POS = 1;
		static const int LINE_ZERO = 0;
		static const int FIRST_POS = 0;
		static const int INVALID_NO_NEG_ONE = -1;
		static const int INVALID_NO_SPACE = -1;
		static const int NO_DATE = 0;
		static const int POS_OF_FIRST_MARKED_IN_VECTOR = 7;
		static const int MOD_ONE_HUNDRED = 100;
		static const int LENGTH_OF_FIRST_CHAR_IN_NEXT_LINE = 1;
		static const int SPACE_AT_ZERO_POS = 0;
		static const int START_AFTER_SPACE = 1;
		static const int NUM_OF_COLUMNS = 8;
		static const int SHIFT_INDEX_BY_ONE = 1;
		static const int ONE_REQUIRED_INFO = 1;
		static const int ONE_UNACCOUNTED_LAST_ROW = 1;
		static const int NO_UNACCOUNTED_LAST_ROW = 0;
		static const int BEGINNING_POS = 0;
		static const int ONE_OVERALL_EXTRA_LINE_NEEDED = 0;
		static const int COUNTER_RESET = 0;
		static const int NO_LINE = -1;

//@author A0099983B
	private: String^ _username;
	private: String^ _previousUserInput;
	private: String^ _currentUserInput;
	private: int _noOfUpPressed;
	private: int _noOfDownPressed;
	private: cliext::vector<String^>  _allUserInputs;
	private: int _currentLinePos;
	private: String^ _tempUserLine;
	private: String^ _previousEditItemNo;
	private: String^ _currentEditItemNo;
	private: int _currFieldNo;
	private: String^ _currCommand;
	private: String^ _prevCommand;
	private: System::Windows::Forms::Label^  possibleCommandsLabel;
	private: enum class typeOfTask : char { presentAndNotDone, presentAndDone, future, pastAndDone, pastAndNotDone, futureAndNotDone, futureAndDone, invalid };
	private: TaskItScheduler* userScheduler;

	//@author IDE
	private: System::Windows::Forms::TextBox^  statusOutputBox;
	private: System::Windows::Forms::ColumnHeader^  Index;
	private: System::Windows::Forms::ColumnHeader^  Activity;
	private: System::Windows::Forms::ColumnHeader^  Venue;
	private: System::Windows::Forms::ColumnHeader^  StartTime;
	private: System::Windows::Forms::ListView^  listOutput;
	private: System::Windows::Forms::ColumnHeader^  EndTime;
	private: System::Windows::Forms::ColumnHeader^  Category;
	private: System::Windows::Forms::ColumnHeader^  Date;
	private: System::Windows::Forms::ColumnHeader^  Marked;
	private: System::Windows::Forms::MonthCalendar^  monthlyCalendar;
	private: System::Windows::Forms::TextBox^  floatingTaskOutputBox;
	private: System::Windows::Forms::Label^  floatingTaskLabel;
	private: System::Windows::Forms::Label^  feedbackLabel;
	private: System::Windows::Forms::Label^  redLabel;
	private: System::Windows::Forms::Label^  yellowLabel;
	private: System::Windows::Forms::Label^  greenLabel;
	private: System::Windows::Forms::Label^  overdueTaskLabel;
	private: System::Windows::Forms::Label^  todaysTaskLabel;
	private: System::Windows::Forms::Label^  doneTaskLabel;
	protected:System::Windows::Forms::ListViewItem^ listViewItem;
	private: System::Windows::Forms::TextBox^  inputBox;
	private: System::ComponentModel::IContainer^  components;
			 //@author A0099983B
	public:
		TaskItGUI() {
			InitializeComponent();
			setUsername(USERNAME);
			string usernameStr;
			usernameStr = convertToString(getUsername());
			userScheduler = new TaskItScheduler();
			userScheduler->setOwnerName(usernameStr);
			addUserInputLine(EMPTY_STRING);
			setCurrentLinePos(NO_LINE);
			setTempUserLine(EMPTY_STRING);
			setCurrFieldNo();
			resetEditItemNumber();
			setCurrCommand(SPACE);
			setPrevCommand(EMPTY_STRING);
		}

	protected:
		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		~TaskItGUI() {
			if (components)	{
				delete components;
				delete userScheduler;
			}
		}
	private:
		/// <summary>
		/// Required designer variable.
		/// </summary>

#pragma region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		void InitializeComponent(void) {
			System::ComponentModel::ComponentResourceManager^  resources = (gcnew System::ComponentModel::ComponentResourceManager(TaskItGUI::typeid));
			this->inputBox = (gcnew System::Windows::Forms::TextBox());
			this->statusOutputBox = (gcnew System::Windows::Forms::TextBox());
			this->Index = (gcnew System::Windows::Forms::ColumnHeader());
			this->Activity = (gcnew System::Windows::Forms::ColumnHeader());
			this->Venue = (gcnew System::Windows::Forms::ColumnHeader());
			this->StartTime = (gcnew System::Windows::Forms::ColumnHeader());
			this->listOutput = (gcnew System::Windows::Forms::ListView());
			this->EndTime = (gcnew System::Windows::Forms::ColumnHeader());
			this->Category = (gcnew System::Windows::Forms::ColumnHeader());
			this->Date = (gcnew System::Windows::Forms::ColumnHeader());
			this->Marked = (gcnew System::Windows::Forms::ColumnHeader());
			this->monthlyCalendar = (gcnew System::Windows::Forms::MonthCalendar());
			this->floatingTaskOutputBox = (gcnew System::Windows::Forms::TextBox());
			this->floatingTaskLabel = (gcnew System::Windows::Forms::Label());
			this->feedbackLabel = (gcnew System::Windows::Forms::Label());
			this->possibleCommandsLabel = (gcnew System::Windows::Forms::Label());
			this->redLabel = (gcnew System::Windows::Forms::Label());
			this->yellowLabel = (gcnew System::Windows::Forms::Label());
			this->greenLabel = (gcnew System::Windows::Forms::Label());
			this->overdueTaskLabel = (gcnew System::Windows::Forms::Label());
			this->todaysTaskLabel = (gcnew System::Windows::Forms::Label());
			this->doneTaskLabel = (gcnew System::Windows::Forms::Label());
			this->SuspendLayout();
			// 
			// inputBox
			// 
			this->inputBox->Font = (gcnew System::Drawing::Font(L"Segoe UI", 11.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
				static_cast<System::Byte>(0)));
			this->inputBox->Location = System::Drawing::Point(24, 518);
			this->inputBox->Multiline = true;
			this->inputBox->Name = L"inputBox";
			this->inputBox->ScrollBars = System::Windows::Forms::ScrollBars::Horizontal;
			this->inputBox->Size = System::Drawing::Size(1282, 28);
			this->inputBox->TabIndex = 0;
			this->inputBox->Text = L"What would you like to do\?";
			this->inputBox->TextChanged += gcnew System::EventHandler(this, &TaskItGUI::inputBox_TextChanged);
			this->inputBox->KeyDown += gcnew System::Windows::Forms::KeyEventHandler(this, &TaskItGUI::inputBox_KeyDown);
			this->inputBox->KeyUp += gcnew System::Windows::Forms::KeyEventHandler(this, &TaskItGUI::inputBox_KeyUp);
			// 
			// statusOutputBox
			// 
			this->statusOutputBox->BackColor = System::Drawing::SystemColors::Window;
			this->statusOutputBox->Font = (gcnew System::Drawing::Font(L"Segoe UI", 9.75F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
				static_cast<System::Byte>(0)));
			this->statusOutputBox->Location = System::Drawing::Point(1073, 248);
			this->statusOutputBox->Multiline = true;
			this->statusOutputBox->Name = L"statusOutputBox";
			this->statusOutputBox->ReadOnly = true;
			this->statusOutputBox->ScrollBars = System::Windows::Forms::ScrollBars::Vertical;
			this->statusOutputBox->Size = System::Drawing::Size(226, 264);
			this->statusOutputBox->TabIndex = 3;
			this->statusOutputBox->TabStop = false;
			// 
			// Index
			// 
			this->Index->Text = L"No.";
			this->Index->Width = 40;
			// 
			// Activity
			// 
			this->Activity->Text = L"Activity";
			this->Activity->TextAlign = System::Windows::Forms::HorizontalAlignment::Center;
			this->Activity->Width = 237;
			// 
			// Venue
			// 
			this->Venue->Text = L"Venue";
			this->Venue->TextAlign = System::Windows::Forms::HorizontalAlignment::Center;
			this->Venue->Width = 100;
			// 
			// StartTime
			// 
			this->StartTime->Text = L"Start Time";
			this->StartTime->TextAlign = System::Windows::Forms::HorizontalAlignment::Center;
			this->StartTime->Width = 80;
			// 
			// listOutput
			// 
			this->listOutput->BackColor = System::Drawing::Color::White;
			this->listOutput->Columns->AddRange(gcnew cli::array< System::Windows::Forms::ColumnHeader^  >(8) {
				this->Index, this->Activity,
					this->Venue, this->StartTime, this->EndTime, this->Category, this->Date, this->Marked
			});
			this->listOutput->Font = (gcnew System::Drawing::Font(L"Segoe UI", 11.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
				static_cast<System::Byte>(0)));
			this->listOutput->Location = System::Drawing::Point(24, 57);
			this->listOutput->MultiSelect = false;
			this->listOutput->Name = L"listOutput";
			this->listOutput->Size = System::Drawing::Size(786, 455);
			this->listOutput->TabIndex = 7;
			this->listOutput->TabStop = false;
			this->listOutput->UseCompatibleStateImageBehavior = false;
			this->listOutput->View = System::Windows::Forms::View::Details;
			// 
			// EndTime
			// 
			this->EndTime->Text = L"End Time";
			this->EndTime->TextAlign = System::Windows::Forms::HorizontalAlignment::Center;
			this->EndTime->Width = 80;
			// 
			// Category
			// 
			this->Category->Text = L"Category";
			this->Category->TextAlign = System::Windows::Forms::HorizontalAlignment::Center;
			this->Category->Width = 100;
			// 
			// Date
			// 
			this->Date->Text = L"Date";
			this->Date->TextAlign = System::Windows::Forms::HorizontalAlignment::Center;
			// 
			// Marked
			// 
			this->Marked->Text = L"Marked";
			this->Marked->TextAlign = System::Windows::Forms::HorizontalAlignment::Center;
			this->Marked->Width = 80;
			// 
			// monthlyCalendar
			// 
			this->monthlyCalendar->BackColor = System::Drawing::SystemColors::HotTrack;
			this->monthlyCalendar->Font = (gcnew System::Drawing::Font(L"Segoe UI", 9.75F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
				static_cast<System::Byte>(0)));
			this->monthlyCalendar->ForeColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(255)), static_cast<System::Int32>(static_cast<System::Byte>(255)),
				static_cast<System::Int32>(static_cast<System::Byte>(128)));
			this->monthlyCalendar->Location = System::Drawing::Point(1072, 57);
			this->monthlyCalendar->Name = L"monthlyCalendar";
			this->monthlyCalendar->TabIndex = 9;
			this->monthlyCalendar->TabStop = false;
			this->monthlyCalendar->TrailingForeColor = System::Drawing::Color::LightGray;
			// 
			// floatingTaskOutputBox
			// 
			this->floatingTaskOutputBox->BackColor = System::Drawing::SystemColors::Window;
			this->floatingTaskOutputBox->Font = (gcnew System::Drawing::Font(L"Segoe UI", 9.75F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
				static_cast<System::Byte>(0)));
			this->floatingTaskOutputBox->Location = System::Drawing::Point(826, 81);
			this->floatingTaskOutputBox->Multiline = true;
			this->floatingTaskOutputBox->Name = L"floatingTaskOutputBox";
			this->floatingTaskOutputBox->ReadOnly = true;
			this->floatingTaskOutputBox->ScrollBars = System::Windows::Forms::ScrollBars::Vertical;
			this->floatingTaskOutputBox->Size = System::Drawing::Size(234, 357);
			this->floatingTaskOutputBox->TabIndex = 10;
			this->floatingTaskOutputBox->TabStop = false;
			// 
			// floatingTaskLabel
			// 
			this->floatingTaskLabel->AutoSize = true;
			this->floatingTaskLabel->BackColor = System::Drawing::Color::Transparent;
			this->floatingTaskLabel->Font = (gcnew System::Drawing::Font(L"Segoe UI", 12, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
				static_cast<System::Byte>(0)));
			this->floatingTaskLabel->Location = System::Drawing::Point(825, 57);
			this->floatingTaskLabel->Name = L"floatingTaskLabel";
			this->floatingTaskLabel->Size = System::Drawing::Size(197, 21);
			this->floatingTaskLabel->TabIndex = 11;
			this->floatingTaskLabel->Text = L"Activities during Free Time:";
			// 
			// feedbackLabel
			// 
			this->feedbackLabel->AutoSize = true;
			this->feedbackLabel->BackColor = System::Drawing::Color::Transparent;
			this->feedbackLabel->Font = (gcnew System::Drawing::Font(L"Segoe UI", 12, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
				static_cast<System::Byte>(0)));
			this->feedbackLabel->Location = System::Drawing::Point(1069, 224);
			this->feedbackLabel->Name = L"feedbackLabel";
			this->feedbackLabel->Size = System::Drawing::Size(82, 21);
			this->feedbackLabel->TabIndex = 12;
			this->feedbackLabel->Text = L"Feedback :";
			// 
			// possibleCommandsLabel
			// 
			this->possibleCommandsLabel->AutoSize = true;
			this->possibleCommandsLabel->BackColor = System::Drawing::Color::Transparent;
			this->possibleCommandsLabel->Font = (gcnew System::Drawing::Font(L"Segoe UI", 9.75F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
				static_cast<System::Byte>(0)));
			this->possibleCommandsLabel->Location = System::Drawing::Point(21, 549);
			this->possibleCommandsLabel->Name = L"possibleCommandsLabel";
			this->possibleCommandsLabel->Size = System::Drawing::Size(615, 17);
			this->possibleCommandsLabel->TabIndex = 13;
			this->possibleCommandsLabel->Text = L"Commands: add, delete, fdelete, edit, fedit, view, mark, unmark, block, confirm, "
				L"undo, search, clear, help.";
			// 
			// redLabel
			// 
			this->redLabel->AutoSize = true;
			this->redLabel->BackColor = System::Drawing::Color::Red;
			this->redLabel->Location = System::Drawing::Point(826, 441);
			this->redLabel->Name = L"redLabel";
			this->redLabel->Size = System::Drawing::Size(22, 13);
			this->redLabel->TabIndex = 14;
			this->redLabel->Text = L"     ";
			// 
			// yellowLabel
			// 
			this->yellowLabel->AutoSize = true;
			this->yellowLabel->BackColor = System::Drawing::Color::Yellow;
			this->yellowLabel->Location = System::Drawing::Point(826, 468);
			this->yellowLabel->Name = L"yellowLabel";
			this->yellowLabel->Size = System::Drawing::Size(22, 13);
			this->yellowLabel->TabIndex = 15;
			this->yellowLabel->Text = L"     ";
			// 
			// greenLabel
			// 
			this->greenLabel->AutoSize = true;
			this->greenLabel->BackColor = System::Drawing::Color::GreenYellow;
			this->greenLabel->Location = System::Drawing::Point(826, 496);
			this->greenLabel->Name = L"greenLabel";
			this->greenLabel->Size = System::Drawing::Size(22, 13);
			this->greenLabel->TabIndex = 16;
			this->greenLabel->Text = L"     ";
			// 
			// overdueTaskLabel
			// 
			this->overdueTaskLabel->AutoSize = true;
			this->overdueTaskLabel->BackColor = System::Drawing::Color::Transparent;
			this->overdueTaskLabel->Font = (gcnew System::Drawing::Font(L"Segoe UI", 9.75F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
				static_cast<System::Byte>(0)));
			this->overdueTaskLabel->Location = System::Drawing::Point(866, 441);
			this->overdueTaskLabel->Name = L"overdueTaskLabel";
			this->overdueTaskLabel->Size = System::Drawing::Size(142, 17);
			this->overdueTaskLabel->TabIndex = 17;
			this->overdueTaskLabel->Text = L"Overdue task not done";
			// 
			// todaysTaskLabel
			// 
			this->todaysTaskLabel->AutoSize = true;
			this->todaysTaskLabel->BackColor = System::Drawing::Color::Transparent;
			this->todaysTaskLabel->Font = (gcnew System::Drawing::Font(L"Segoe UI", 9.75F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
				static_cast<System::Byte>(0)));
			this->todaysTaskLabel->Location = System::Drawing::Point(866, 465);
			this->todaysTaskLabel->Name = L"todaysTaskLabel";
			this->todaysTaskLabel->Size = System::Drawing::Size(137, 17);
			this->todaysTaskLabel->TabIndex = 18;
			this->todaysTaskLabel->Text = L"Today\'s task not done";
			// 
			// doneTaskLabel
			// 
			this->doneTaskLabel->AutoSize = true;
			this->doneTaskLabel->BackColor = System::Drawing::Color::Transparent;
			this->doneTaskLabel->Font = (gcnew System::Drawing::Font(L"Segoe UI", 9.75F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
				static_cast<System::Byte>(0)));
			this->doneTaskLabel->Location = System::Drawing::Point(866, 493);
			this->doneTaskLabel->Name = L"doneTaskLabel";
			this->doneTaskLabel->Size = System::Drawing::Size(66, 17);
			this->doneTaskLabel->TabIndex = 19;
			this->doneTaskLabel->Text = L"Done task";
			// 
			// TaskItGUI
			// 
			this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
			this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
			this->AutoScroll = true;
			this->BackColor = System::Drawing::Color::White;
			this->BackgroundImage = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"$this.BackgroundImage")));
			this->ClientSize = System::Drawing::Size(1317, 582);
			this->Controls->Add(this->doneTaskLabel);
			this->Controls->Add(this->todaysTaskLabel);
			this->Controls->Add(this->overdueTaskLabel);
			this->Controls->Add(this->greenLabel);
			this->Controls->Add(this->yellowLabel);
			this->Controls->Add(this->redLabel);
			this->Controls->Add(this->possibleCommandsLabel);
			this->Controls->Add(this->feedbackLabel);
			this->Controls->Add(this->floatingTaskLabel);
			this->Controls->Add(this->floatingTaskOutputBox);
			this->Controls->Add(this->monthlyCalendar);
			this->Controls->Add(this->listOutput);
			this->Controls->Add(this->statusOutputBox);
			this->Controls->Add(this->inputBox);
			this->Font = (gcnew System::Drawing::Font(L"Segoe UI", 8.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
				static_cast<System::Byte>(0)));
			this->ForeColor = System::Drawing::Color::Black;
			this->FormBorderStyle = System::Windows::Forms::FormBorderStyle::FixedSingle;
			this->Icon = (cli::safe_cast<System::Drawing::Icon^>(resources->GetObject(L"$this.Icon")));
			this->Margin = System::Windows::Forms::Padding(1, 2, 1, 2);
			this->MaximizeBox = false;
			this->Name = L"TaskItGUI";
			this->RightToLeft = System::Windows::Forms::RightToLeft::No;
			this->StartPosition = System::Windows::Forms::FormStartPosition::CenterScreen;
			this->Text = L"TaskIt";
			this->FormClosing += gcnew System::Windows::Forms::FormClosingEventHandler(this, &TaskItGUI::Application_ApplicationClosing);
			this->Load += gcnew System::EventHandler(this, &TaskItGUI::TaskItGUI_Load);
			this->ResumeLayout(false);
			this->PerformLayout();

		}
#pragma endregion

	//@author A0099983B
	//This function will be called automatically when the UI loads.
	//Pre-req:Program to be run
	//Post-Req: Displays the tasks that are overdue and on today.
	//The calender will also update to bold the dates with existing tasks.
	//The floating tasks will also be updated to get the existing tasks.
	private:System::Void TaskItGUI_Load(System::Object^ sender, System::EventArgs^ e) {
				bool displayAtSmallWindow = true;
				String^ welcomeMessage;
				String^ systemOutputMsg = convertToCliString(userScheduler->initialWelcome(displayAtSmallWindow));
				welcomeMessage = systemOutputMsg;

				if (displayAtSmallWindow) {
					statusOutputBox->Text = welcomeMessage;
				}

				std::vector<string> todayTaskInfo;
				todayTaskInfo = userScheduler->viewToday(displayAtSmallWindow);
				if (!displayAtSmallWindow) {
					displayTasks(todayTaskInfo);
				}
				refreshFloatingTasks();
				refreshCalendarBoldedDates();
	}

	//This function will be called when the user type or removed a char from the inputBox.
	//Pre-Req: The UI has loaded.
	//Post-Req: The prompts relevant to the command will display, edit will have advanced prompts
	//			and search will provide a live search according to the keyword.
	private:System::Void inputBox_TextChanged(System::Object^ sender, System::EventArgs^ e) {
				if (checkIfFirstWordCommand() && checkIfNoCommandBeforeThisCommand() && noTextAfterCommand()) { 
					// for only 1 word
					provideBasicPromptsToUser();
				}else if ((checkIfBasicEditPromptsPresent() && (_prevCommand !=  COMMAND_FEDIT))){
					checkEditNoValidAndDisplayCorrectEditPrompts(); 
				}else if (checkIfBasicFEditPromptsPresent() && (_prevCommand != COMMAND_EDIT)) {
					checkFEditNoValidAndDisplayCorrectFEditPrompts(); 
				} else if (checkIfFirstWordCommand() && checkIfNoCommandBeforeThisCommand()) {
					// to prevent retrieval of prompts upon up/down keys.
				} else if ((checkIfFirstWordCommand() && !checkPrevCommandEqualCurrentCommand())) {
					// to change all the words with a change in command word
					changePromptsAccordingToNewCommand();
					resetEditItemNumber();						
				} else if (checkFirstWordIsSearch() && checkNoandAltBrackets(ONE_SET_OF_BRACKET)) {
					try {
						provideLiveSearch();
					} catch (string error) {
						String^ taskInfo;
						taskInfo = convertToCliString(error);
						statusOutputBox->Text = taskInfo;
					}
				}
	}

	//This function will be called when the user presses any key down.
	//Pre-Req: The UI has loaded.
	//Post-Req: Enter key will allow the input text to processInputAndShowCorrectDisplayToUser(), 
	//			up key will retrive previously entered lines, down key will retrieve the next line
	//			entered given that a previous line has entered. F1 key will be able to show help to user.
	private:System::Void inputBox_KeyDown(System::Object^ sender, System::Windows::Forms::KeyEventArgs^ e) {
				if (e->KeyCode == Keys::Enter) {
					if (inputBox->Text == EMPTY_STRING || inputBox->Text == WHAT_YOU_YOU_LIKE_TO_DO) {
						statusOutputBox->Text = NO_INPUT_DETECTED;
					} else {
						addUserInputLine(inputBox->Text);
						try {
							processInputAndShowCorrectDisplayToUser();
							refreshCalendarBoldedDates();
							refreshFloatingTasks();
						} catch (string error) {
							String^ taskInfo;
							taskInfo = convertToCliString(error);
							statusOutputBox->Text = taskInfo;
						}
					}
					resetEditItemNumber();
					setPrevCommand(EMPTY_STRING);
					setCurrCommand(EMPTY_STRING);
					_currentLinePos = getTotalLinesEntered() - ACCOUNT_FOR_CONV_FROM_SIZE_TO_POS;
				} else if (e->KeyCode == Keys::Up) {//only valid if user has entered something before this.
					resetEditItemNumber();
					setPrevCommand(EMPTY_STRING);
					setCurrCommand(EMPTY_STRING);
					retrievePreviousUserEnteredInfo();
				} else if (e->KeyCode == Keys::Down) {//only valid if user is not at the most recent entry
					setPrevCommand(EMPTY_STRING);
					setCurrCommand(EMPTY_STRING);
					resetEditItemNumber();
					retrieveNextUserEnteredInfo();
				} else if (e->KeyCode == Keys::F1) {
					showHelpToUser();
				}
	}

	//This function will be called when the user up any key.
	//Pre-Req: The UI has loaded.
	//Post-Req: Ensures that the input text is removed after entering and the the edit item number is reset.
	//			The tab will highlight fields if an exisiting command is present.
	private:System::Void inputBox_KeyUp(System::Object^ sender, System::Windows::Forms::KeyEventArgs^ e) {
				if (e->KeyCode == Keys::Enter) {
					inputBox->Clear();
					resetEditItemNumber();
				} else if (e->KeyCode == Keys::Tab) {
					if (checkIfFirstWordCommand()) {
						int posOfSpace = INVALID_NO_SPACE;
						posOfSpace = inputBox->Text->IndexOf(posOfSpace);
						if (posOfSpace > SPACE_AT_ZERO_POS) {
							_prevCommand = inputBox->Text->Substring(BEGINNING_POS_OF_STR, posOfSpace + ACCOUNT_FOR_CONV_FROM_POS_TO_LENGTH);
						}
					}
					highlightCompleteFields();
				}
	}

	//This function will ensures that the program closes completely and do not run in the background.
	//Pre-Req: The UI has loaded.
	//Post-Req: Closes the program completely.
	private:System::Void Application_ApplicationClosing(System::Object^ sender, System::Windows::Forms::FormClosingEventArgs^ e) {
				Application::Exit();
	}

	//This function aids the display background colour of the task by categorising the type of task here.
	//Pre-Req: There is task with date and markedStatus
	//Post-Req: Categorise the tasks according to the date and the marked status.
	private:typeOfTask checkTypeOfTasks(int date, string markedStatus) {
				System::DateTime todayDate = this->monthlyCalendar->TodayDate;
				String^ status = convertToCliString(markedStatus);

				int year = YEAR_TWO_THOUSAND + date % MOD_ONE_HUNDRED;
				date = date / MOD_ONE_HUNDRED;
				int month = date % MOD_ONE_HUNDRED;
				date = date / MOD_ONE_HUNDRED;
				int day = date % MOD_ONE_HUNDRED;

				if (year > todayDate.Year || 
					((year == todayDate.Year) && (month > (todayDate.Month))) ||
					(year == todayDate.Year) && (month == todayDate.Month) && (day > todayDate.Day)) {
					if (status == DONE) {
						return typeOfTask::futureAndDone;
					}
					return typeOfTask::futureAndNotDone;
				} else if (year < todayDate.Year ||
					(year == todayDate.Year) && month < (todayDate.Month) ||
					(year == todayDate.Year && ( month == todayDate.Month) && day < todayDate.Day)) {
					if (status == DONE) {
						return typeOfTask::pastAndDone;
					}
					return typeOfTask::pastAndNotDone;
				} else if (year == todayDate.Year && month == (todayDate.Month) && day == todayDate.Day) {
					if (status == DONE) {
						return typeOfTask::presentAndDone;
					}
					return typeOfTask::presentAndNotDone;
				}
				return typeOfTask::invalid;
	}

	//This function will retrieve the previous entered info.This is used when user pressed the up key.
	//Pre-Req:There is a previous entered info.
	//Post-Req:The inputbox text will display the previous entered info.
	private:void retrievePreviousUserEnteredInfo();

	//This function will retrieve the next entered info.This is used when user pressed the down key.
	//Pre-Req:There is a next entered info.
	//Post-Req:The inputbox text will display the next entered info.
	private:void retrieveNextUserEnteredInfo();

	//This function will update the small window with the lastest correct info.
	//Pre-Req:There is a change in the info to be displayed in the small window.
	//Post-Req:The small window gets update.
	private:void updateSmallWindow(String^ updatedInfo);

	//This function will process the input by the user and display the feedback to the
	//correct window
	//Pre-Req:There is an input from the user
	//Post-Req:The user input is processed and the appropraite window is displaying the right message
	private:void processInputAndShowCorrectDisplayToUser();

	//This function show the help window to the user.
	//Pre-Req:user presses F1 for this to be activated.
	//Post-Req:Help window is displayed to user.
	private:void showHelpToUser();
			
	//This function will highlight the fields when the complete set of brackets are present.
	//Pre-Req:complete set of brackets are present according to the command.
	//Post-Req:the next field gets highlighted.
	private:void highlightCompleteFields();
	
	//This function will check if the number and alternatation of the brackets are correct.
	//Pre-Req:There are brackets in the input box.
	//Post-Req:Return true or false that the number and alternation of the brackets are correct.
	private:bool checkNoandAltBrackets(int correctNoSetOfBrackets);

	//This function will highlight fields according to the command
	//Pre-Req:There are is a command and there are brackets
	//Post-Req:Return true or false that the number and alternation of the brackets are correct.
	private:void highlightFieldsCorrespondingToCommand(int commandNoOfFields);

	//This function will set the dates to be bolded in the calendar.
	//Pre-Req: There are dates to be bolded.
	//Post-Req: The set of bolded dates are reflected in the calendar.
	private:void setBoldedDatesForCalendar();

	//This function will refresh the calendar and update it with the correct bolded dates.
	//Pre-Req:N.A
	//Post-Req: The set of updated bolded dates are reflected in the calendar.
	private:void refreshCalendarBoldedDates();

	//This function will refresh the floating tasks to the latest updated version.
	//Pre-Req: N.A
	//Post-Req: The floating task window will get an updated view.
	private:void refreshFloatingTasks();

	//This function will reset the current and previous edit item number.
	//Pre-Req: N.A
	//Post-Req: The current and previous edit item number is reset to and invalid number
	private:void resetEditItemNumber();

	//This function will display the all the tasks in the main window row by row, column by column
	//Pre-Req: The current and previous edit item number is reset to and invalid number
	//Post-Req: Tasks are displayed in the main window with word wrap (words are not truncated)
	private:void displayTasks(std::vector<string> allTasks);

	//This function will check if the last character in the first line of the max possible length is a space.
	//Pre-Req: There is text to be entered in this particular column and max possible text length for the column is available.
	//Post-Req: The function will return a true or false is the last character in the first line is a space.
	private:bool checkLastCharFirstLineMaxPossibleLengthIsSpace(String^ taskInfo, int maxPossibleTextLength);

    //This function will check if the first character in the sec line of the max possible length is a space.
	//Pre-Req: There is text to be entered in this particular column and max possible text length for the column is available.
	//Post-Req: The function will return a true or false is the first character in the sec line is a space.
	private:bool checkFirstCharInSecLineOfMaxPossibleLengthIsSpace(String^ taskInfo, int maxPossibleTextLength);

	//This function will check if the first character in the sec line of the max possible length is a space.
	//Pre-Req: There is text to be entered in this particular column and max possible text length for the 
	//			column is available and non negative.
	//Post-Req: The function will return a true or false is the first character in the second line is a space.
	private:bool checkForSpaceinFirstLine(String^ taskInfo, int maxPossibleTextLength);

	//This function will insert the first line of the text with word wrap (without any truncation of a word)
	//Pre-Req: There is text to be entered in this particular column and max possible text length for the 
	//			column is available and non negative.The taskInfo to be  added is longer than a line.
	//Post-Req: The function will insert the first line of the text with word wrap and the remaining long text not inserted is updated.
	private:void getFirstLineWithoutTruncation(String^ taskInfo, int maxPossibleTextLength, String^ &remainingLongText);

	//This function will insert the remaining of the text for all columns for a particular task.
	//Pre-Req: One or more of the activity, venue or category needs more than one line to display in the column 
	//		   and there is a current type of task.
	//Post-Req: remaining lines which are not in the first line will be inserted for the task.
	private:void displayRemainingMultilineForThisTask(String^ remainingLongActivity, String^ remainingLongVenue, 
													  String^ remainingLongCategory, typeOfTask currentTypeOfTask);

	//This function will insert text for a row of a column without truncation (having word wrap).
	//This is used for all lines except for the first line.
	//Pre-Req: One or more of the activity, venue or category have something to display in the row.
	//Post-Req: remaining lines which are not in the first line will be inserted for the task.
	//			noOfExtraLinesNeededText and i will be updated according to the amount of text pushed to the next line.
	private:String^ getCurrentLineWithoutTruncation(String^ remainingLongText, int& textStartPos, int maxPossibleTextLength, 
													int noOfOverallExtraLinesNeeded, int &i, int &noOfExtraLinesNeededText);
	
	//This function check if more than one row is needed to insert the activity in the row of the column.
	//Pre-Req:N.A
	//Post-Req: Returns if more than one line is needed for the activity of the task.
	private:bool checkMultilineNeededForActivity(String^ activity);
	
	//This function check if more than one row is needed to insert the venue in the row of the column.
	//Pre-Req:N.A
	//Post-Req: Returns if more than one line is needed for the venue of the task.
	private:bool checkMultilineNeededForVenue(String^ venue);

	//This function check if more than one row is needed to insert the category in the row of the column.
	//Pre-Req:N.A
	//Post-Req: Returns if more than one line is needed for the category of the task.
	private:bool checkMultilineNeededForCategory(String^ category);

	//This function update the background colour in the big window according to the type of task. 
	//Pre-Req: CurrentTypeOfTask is existant.
	//Post-Req: Returns if more than one line is needed for the category of the task.
	private:void updateBackgroundColourToTypeOfTask(typeOfTask currentTypeOfTask);
	
	//This function will check if the first word in the text is search.
	//Pre-Req: there is text in the input text box and the length is greater than or equal to 6
	//Post-Req: Returns true or false if the first word is search.
	private:bool checkFirstWordIsSearch();
	
	//This function update the big window if the search command is entered by the user.
	//Pre-Req: user has entered the search command.
	//Post-Req: the big window is updated with the current keyword for search.
	private:void provideLiveSearch();

	//This function will provide the basic prompts in the input box 
	//Pre-Req: user has entered the correct command after an enter or for the first time.
	//Post-Req: Input box will have the basic prompts displayed according to the command.
	private:void provideBasicPromptsToUser();

	//This function will check if there is no command entered before a command is typed in the input box.
	//Pre-Req:This is to check if the first word of the input text is a command, first word has to be a command.
	//Post-Req: Returns true or false if there is a command before this command.
	private:bool checkIfNoCommandBeforeThisCommand();

	//This function will check if the edit no is valid and display correct advanced prompts.
	//Pre-Req:The command edit and at least a char is present between the two square brackets.
	//Post-Req: Input box will the the corresponding advanced prompts displayed if number is valid or 
	//			show no advanced prompt if number is valid.
	private:void checkEditNoValidAndDisplayCorrectEditPrompts();

	//This function will check if the fedit no is valid and display correct advanced prompts.
	//Pre-Req:The command fedit and at least a char is present between the two square brackets.
	//Post-Req: Input box will the the corresponding advanced prompts displayed if number is valid or 
	//			show no advanced prompt if number is valid.
	private:void checkFEditNoValidAndDisplayCorrectFEditPrompts();
	
	//This function will change the prompts in the input box acordig to the change of commands	
	//Pre-Req:There is a change of command from valid to valid command.
	//Post-Req: Input box will the the show the corresponding prompt according to the new command.
	private:void changePromptsAccordingToNewCommand();

	//This function will change the prompts in the input box acordig to the change of commands	
	//Pre-Req:There is a change of command from valid to valid command.
	//Post-Req: Input box will the the show the corresponding prompt according to the new command.
	private:bool checkPrevCommandEqualCurrentCommand();

	//This function will check if the characters between the brackets of a basic edit prompt is a number.
	//Pre-Req:Assume that the input is from the characters between the brackets of a basic edit prompt.
	//Post-Req:return true or false if the input is a number.
	private:bool checkIfNumber(String^ input);

	//This function will check if the characters between the brackets of a basic edit prompt is a number.
	//Pre-Req:Assume that the input is from the characters between the brackets of a basic edit prompt.
	//Post-Req:Return true or false if the input is a number.
	private:void startTrackingFieldNo();
			
    //This function will provide the user with the basic prompts of add and highlight the first field.
	//Pre-Req:Will be called only in the change of prompts or after an enter or just open the program.
	//Post-Req:Input box will provide the user with the basic prompts of add and highlight the first field.
	private:void helpUserWithAdd();

	//This function will provide the user with the basic prompts of edit and highlight the first field.
	//Pre-Req:Will be called only in the change of prompts or after an enter or just open the program.
	//Post-Req:Input box will provide the user with the basic prompts of edit and highlight the first field.
	private:void helpUserWithEdit();

	//This function will provide the user with the basic prompts of fdelete and highlight the first field.
	//Pre-Req:Will be called only in the change of prompts or after an enter or just open the program.
	//Post-Req:Input box will provide the user with the basic prompts of fdelete and highlight the first field.
	private:void helpUserWithFDelete();

	//This function will provide the user with the basic prompts of fedit and highlight the first field.
	//Pre-Req:Will be called only in the change of prompts or after an enter or just open the program.
	//Post-Req:Input box will provide the user with the basic prompts of fedit and highlight the first field.
	private:void helpUserWithFEdit();

	//This function will provide the user with the basic prompts of view and highlight the first field.
	//Pre-Req:Will be called only in the change of prompts or after an enter or just open the program.
	//Post-Req:Input box will provide the user with the basic prompts of view and highlight the first field.
	private:void helpUserWithView();

	//This function will provide the user with the basic prompts of delete and highlight the first field.
	//Pre-Req:Will be called only in the change of prompts or after an enter or just open the program.
	//Post-Req:Input box will provide the user with the basic prompts of delete and highlight the first field.
	private:void helpUserWithDelete();

	//This function will provide the user with the basic prompts of search and highlight the first field.
	//Pre-Req:Will be called only in the change of prompts or after an enter or just open the program.
	//Post-Req:Input box will provide the user with the basic prompts of search and highlight the first field.
	private:void helpUserWithSearch();

	//This function will provide the user with the basic prompts of mark and highlight the first field.
	//Pre-Req:Will be called only in the change of prompts or after an enter or just open the program.
	//Post-Req:Input box will provide the user with the basic prompts of mark and highlight the first field.
	private:void helpUserWithMark();

	//This function will provide the user with the basic prompts of block and highlight the first field.
	//Pre-Req:Will be called only in the change of prompts or after an enter or just open the program.
	//Post-Req:Input box will provide the user with the basic prompts of block and highlight the first field.
	private:void helpUserWithBlock();

	//This function will provide the user with the basic prompts of unmark and highlight the first field.
	//Pre-Req:Will be called only in the change of prompts or after an enter or just open the program.
	//Post-Req:Input box will provide the user with the basic prompts of unmark and highlight the first field.
	private:void helpUserWithUnmark();

	//This function will highlight the first field.
	//Pre-Req:Will be called only in the change of prompts.
	//Post-Req:Input box will provide the highlight the word.
	private:void helpUserWithConfirm();
			
	//This function will highlight the first field.
	//Pre-Req:Will be called only in the change of prompts.
	//Post-Req:Input box will provide the highlight the word.
	private:void helpUserWithClear();

	//This function will highlight the first field.
	//Pre-Req:Will be called only in the change of prompts.
	//Post-Req:Input box will provide the highlight the word.
	private:void helpUserWithUndo();

	//This function will get the advanced edit prompts.
	//Pre-Req:There is number in the first field of the edit, the number in the first bracket is valid.
	//Post-Req:Input box will provide additional prompts on top of those basic prompts.
	private:void getAdvancedEditPrompts(int noOfDigits);
	
	//This function will get the advanced fedit prompts.
	//Pre-Req:There is number in the first field of the fedit, the number in the first bracket is valid.
	//Post-Req::Input box will provide additional prompts on top of those basic prompts.
	private:void getAdvancedFEditPrompts(int noOfDigits);
	
	//This function will check with the edit inputs are number.
	//Pre-Req:There is number in the first field of the edit
	//Post-Req:This will return true or false that the edit input are number.
	private:bool checkIfEditInputsAreNumbers(int noOfChar);

	//This function will check with the  fedit inputs are number.
	//Pre-Req:There is number in the first field of the fedit
	//Post-Req:This will return true or false that the fedit input are number.
	private:bool checkIfFEditInputsAreNumbers(int noOfChar);

	//This function will check if there is edit basic prompts
	//Pre-Req:There is text in the input box
	//Post-Req:This will return true or false that the edit basic prompts are present.
	private:bool checkIfBasicEditPromptsPresent();

	//This function will check if there is fedit basic prompts
	//Pre-Req:There is text in the input box
	//Post-Req:This will return true or false that the fedit basic prompts are present.
	private:bool checkIfBasicFEditPromptsPresent();

	//This function will check if there is the first word is in the command.
	//Pre-Req:There is text in the input box
	//Post-Req:This will return true or false that the first word is a command.
	private:bool checkIfFirstWordCommand();

	//This function will set the previous command in the text set.Used for reset or update to the latest command.
	//Pre-Req:N.A
	//Post-Req:Previous command is set to the parameter input.
	private:void setPrevCommand(String^ prevCommand);

	//This function will set the current command in the text set.Used for reset or update to the latest command.
	//Pre-Req:N.A
	//Post-Req:Current command is set to the parameter input.
	private:void setCurrCommand(String^ currCommand);

	//This function will check if there there is only the command in the text input box.
	//Will be used to check for command after every enter.
	//Pre-Req:There is a command in the input text box.
	//Post-Req:Returns true or false if there is no text after the command .
	private:bool noTextAfterCommand();

	//This function will reset the current field number to invalid number.
	//Used to reset the current field no.
	//Pre-Req: N.A
	//Post-Req:Current field number is set to an invalid number.
	private:void setCurrFieldNo();
	
	//This function will set the username of the user.In this case,
	//the name is assumed to be "Jim". This is for naming of the .txt file.
	//Pre-Req: N.A
	//Post-Req:	The username is set in this program.
	private:void setUsername(String^ username);
	
	//This function will retrieve the username.
	//Pre-Req: N.A
	//Post-Req: The username is returned.
	private:String^ getUsername();

	//This function will store the currentUserInput into a vector.
	//Only store after every enter by user.
	//Pre-Req: N.A
	//Post-Req: The line input before a enter by the user is stored in a vector.
	private:void addUserInputLine(String^ currentUserInput);

	//This function will retrieve the user input stored at the index in the parameter.
	//Pre-Req: N.A
	//Post-Req: Returns the user input line at the specified index number in the vector.
	private:String^ getUserInputLine(int index);

	//This function will retrieve the total lines that the user has input into the system by pressing enter.
	//Pre-Req: N.A
	//Post-Req: Retrieves the total number lines that user sent to the system by pressing enter.
	private:int getTotalLinesEntered();

	//This function will retrieve the current line pos. Needed as the user can move up 
	//and down key to retrieve the past and next user input
	//Pre-Req: N.A
	//Post-Req: Returns the current line pos that the user is currently at.
	private:int getCurrentLinePos();

	//This function will retrieve the user input stored at the index in the parameter.
	//Pre-Req: N.A
	//Post-Req: The current and previous edit item number is reset to and invalid number
	private:void setCurrentLinePos(int pos);

	//This function will set the temp user line before he presses the up key in the input box.
	//Pre-Req: N.A
	//Post-Req: Temporary user line is set.
	private:void setTempUserLine(String^ userInput);

	//This function will retrieve the text user input (not yet press enter key) before he uses the up/down key.
	//Pre-Req: User uses the up or down key
	//Post-Req: Retieves a line that a user is inputing when the user presses the down key given that he is at the most recent line entered. 
	private:String^ getTempUserLine();

	//This function will retrieve the user input stored at the index in the parameter.
	//Only data type changes, content of the string remains the same.
	//Pre-Req: N.A
	//Post-Req: Returns a string from the input of String^. 
	private:string convertToString(String^ input);

	//This function is for the conversion of string to String^.Only data type changes but
	// the content of the string remains unchanged.
	//Pre-Req: The input is a string.
	//Post-Req: Returns a string that is converted from the string type to String^ type.
	private:String^ convertToCliString(string input);

	};
}